package com.hua.utility.common.throwable;

public class OrdinaryRuntimeException extends RuntimeException {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1493503414970003431L;

	public static final String className = OrdinaryRuntimeException.class.getName();

	public OrdinaryRuntimeException() {
		super();
	}

	public OrdinaryRuntimeException(String message) {
		super(message);
	}

	public OrdinaryRuntimeException(String message, Throwable cause) {
		super(message, cause);
	}

	public OrdinaryRuntimeException(String message, Throwable cause, boolean enableSuppression,
			boolean writableStackTrace) {
		super(message, cause, enableSuppression, writableStackTrace);
	}

	public OrdinaryRuntimeException(Throwable cause) {
		super(cause);
	}

	public OrdinaryRuntimeException(Exception throwable) {
		super(throwable.getMessage(), throwable.getCause(), throwable.getSuppressed() != null ? true : false, true);
	}

	public static void throwRuntimeException(Object o) {
		if (o == null) {
			return;
		} else if (o instanceof Throwable) {
			throw new RuntimeException(((Throwable) o).getMessage());
		} else {
			throw new RuntimeException(o.toString());
		}
	}

}
